﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using WalkingTec.Mvvm.Core;
using System.Text.Json.Serialization;
using Digitalmes.Model;
using Digitalmes.Model.QcManagement;
using Digitalmes.Model.ProductManagement;

namespace Digitalmes.Model.QcManagement
{
    /// <summary>
    /// 检测项目
    /// </summary>
	[Table("QcInspectItem")]

    [Display(Name = "_Model.QcInspectItem")]
    public class QcInspectItem : BasePoco,IPersistPoco,ITenant
    {
        [Key]
        [Display(Name = "_Model._QcInspectItem._ID")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public new long ID { get; set; }
        [Display(Name = "_Model._QcInspectItem._Template")]
        [Comment("模板")]
        public QcTemplate Template { get; set; }
        [Display(Name = "_Model._QcInspectItem._Template")]
        [Comment("模板")]
        public long? TemplateId { get; set; }
        [Display(Name = "_Model._QcInspectItem._ProductId")]
        [Comment("产品")]
        public long? ProductId { get; set; }

        public Product Product { get; set; }

        [Display(Name = "_Model._QcInspectItem._ProductName")]
        [Comment("产品名称")]
        public string ProductName { get; set; }
        [Display(Name = "_Model._QcInspectItem._QcType")]
        [Comment("检验分类")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public EquipTypeEnum? QcType { get; set; }
        [Display(Name = "_Model._QcInspectItem._InspectName")]
        [Comment("检验项目")]
        public string InspectName { get; set; }
        [Display(Name = "_Model._QcInspectItem._InspectTool")]
        [Comment("检测工具")]
        public string InspectTool { get; set; }
        [Display(Name = "_Model._QcInspectItem._Content")]
        [Comment("检验内容")]
        public string Content { get; set; }
        [Display(Name = "_Model._QcInspectItem._Remark")]
        [Comment("备注")]
        public string Remark { get; set; }
        [Display(Name = "_Model._QcInspectItem._RefValue")]
        [Comment("参考值")]
        public string RefValue { get; set; }
        [Display(Name = "_Model._QcInspectItem._IsValid")]
        [Comment("是否有效")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public bool IsValid { get; set; } = true;
        [StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
        public string TenantCode { get; set; }

	}

}
